<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <script src="js/call.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="UTF-8">
      	mui.init();
    // 监听plusready事件  
	document.addEventListener( "plusready", function(){
		plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, function (addressbook) {
			addressbook.find(["displayName","phoneNumbers"],function(contacts){
				var bts=[];
				var contactArr= unique2(contacts).sort(sortname("name"));
				for(var i=0;i<contactArr.length;i++){
					var name=contactArr[i].displayName;
					var phone=contactArr[i].phoneNumbers;
					if(phone.length>0){
						var phone2=phone[0].value.replace(/\s+/g,"");
						var xinxi="姓名:"+name+"电话号码:"+phone2;
					//弹出框的形式选择联系人
					var node="<li class='mui-table-view-cell'><a class='mui-navigate-right list-text'>"+xinxi+"</a></li>";
					document.getElementsByClassName("mui-table-view")[0].appendChild(node);
//						var obj2={"title":xinxi,"name":name,"phone":phone2};
//						bts.push(JSON.parse(JSON.stringify(obj2)));
					}
					
				}
//				//对数组中的电话号码去重
//				var bts2=;
//				//对数组中的名字进行排序
//				showActionSheet(bts2.sort(sortname("name")));
			}, function () {
				alert("error");
			},{multiple:true});
		},function(e){
			alert("Get address book failed: " + e.message);
		});
	}, false );
    </script>
</head>
<body>
	<div class="container">
		<ul class="mui-table-view">
	    </ul>
	</div>
</body>
</html>